package com.kingmed.kmss.framework.feign.client.kmcs;

import com.kingmed.kmss.common.dto.kmcs.*;
import feign.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "MsFeignService", url = "${kmcs.url}", fallback = MsFeignFallbackService.class)
public interface MsFeignService {

    /**
     *  获取集团检测项目
     */
    @PostMapping(value = "/km-ms/esb/crm/getGroupAllTestItem",
            headers = {"targetServiceCode= ${kmcs.ms.targetServiceCode:MS.CRM.GETGROUPALLTESTITEM}"},
            consumes = MediaType.APPLICATION_JSON_VALUE)
    Response getKMProd(@RequestBody KmcsQueryDTO queryDTO);

    /**
     * 物价级别、物价版本信息
     */
    @PostMapping(value = "/km-ms/esb/crm/getPriceGrade",
            headers = {"targetServiceCode=${kmcs.ms.targetServicePriceCode:MS.CRM.GETPRICEGRADE}"},
            consumes = MediaType.APPLICATION_JSON_VALUE)
    Response itemPrice(@RequestBody KmcsPriceQueryDTO queryDTO);

    /**
     * 套餐列表信息
     */
    @PostMapping(value = "/km-ms/esb/crm/getMpInfoPage",
            headers = {"targetServiceCode=${kmcs.ms.targetServiceMpCode:MS.CRM.GETMPINFOPAGE}"},
            consumes = MediaType.APPLICATION_JSON_VALUE)
    Response kmcsMp(@RequestBody KmcsMpQueryDTO queryDTO);

    @PostMapping(value = "/km-ms/esb/crm/getMpInfoList",
            headers = {"targetServiceCode=${kmcs.ms.targetServiceMpCodeList:MS.CRM.GETMPINFOLIST}"},
            consumes = MediaType.APPLICATION_JSON_VALUE)
    Response kmcsMpList(@RequestBody KmcsMpQueryDTO queryDTO);

    /**
     * 套餐 项目 列表信息
     */
    @PostMapping(value = "/km-ms/esb/crm/getTestItemByMpId",
            headers = {"targetServiceCode=${kmcs.ms.targetServiceMpProdCode:MS.CRM.GETTESTITEMBYMPID}"},
            consumes = MediaType.APPLICATION_JSON_VALUE)
    Response kmcsMpProd(@RequestBody KmcsMpProdQueryDTO queryDTO);


    /**
     * 医院收费、省三级收费标准
     */
    @PostMapping(value = "/km-ms/esb/crm/getMpInfoPriceByMpId",
            headers = {"targetServiceCode=${kmcs.ms.targetServiceFeeCode:MS.CRM.GETMPINFOPRICEBYMPID}"},
            consumes = MediaType.APPLICATION_JSON_VALUE)
    Response chargingStandard(@RequestBody KmcsFeeQueryDTO reqDto);

    /**
     * 根据 mpId 查询医院收费、省三级收费标准
     */
    @PostMapping(value = "/km-ms/esb/crm/getMpInfoProvincePriceByMpId",
            headers = {"targetServiceCode=${kmcs.ms.targetServiceFeeMpCode:MS.CRM.GETMPINFOPROVINCEPRICEBYMPID}"},
            consumes = MediaType.APPLICATION_JSON_VALUE)
    Response getMpInfoProvincePriceByMpId(@RequestBody KmcsFeeQueryDTO reqDto);

    /**
     * 获取合同附件信息
     */
    @GetMapping(value = "/km-ms/esb/crm/getFileInfo",
            headers = {"targetServiceCode=${kmcs.ms.targetServiceFileCode:MS.CRM.GETFILEINFO}"},
            consumes = MediaType.APPLICATION_JSON_VALUE)
    Response getContractFileInfo(@RequestParam("fileUploadId") String fileId);

}
